/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import { request } from '@umijs/max';

/** 登录 */
export async function login(
  body?: API.UserInfoVO,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 公告列表 */
export async function getUserInfo(
  params?:any,
  options?: { [key: string]: any },
) {
  return request<API.Result_PageInfo_UserInfo__>('/api/user/info', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 退出 */
export async function userLogout(
  params?:any,
  options?: { [key: string]: any },
) {
  return request<API.Result_PageInfo_UserInfo__>('/api/user/logout', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 公告列表 */
export async function noticeList(
  params?:any,
  options?: { [key: string]: any },
) {
  return request<API.Result_PageInfo_UserInfo__>('/api/notice/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 发布公告 */
export async function noticeAdd(
  body?: API.UserInfoVO,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/notice/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 修改公告 */
export async function noticeUpdate(
  body?: API.UserInfoVO,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/notice/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 删除公告 */
export async function noticeDelete(
  body?: any,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/notice/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}


/** 教师列表 */
export async function teacherList(
  params?:any,
  options?: { [key: string]: any },
) {
  return request<API.Result_PageInfo_UserInfo__>('/api/teacher/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 添加教师信息 */
export async function teacherAdd(
  body?: API.UserInfoVO,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/teacher/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 修改教师信息 */
export async function teacherUpdate(
  body?: API.UserInfoVO,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/teacher/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 删除教师信息 */
export async function teacherDelete(
  body?: any,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/teacher/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 开关列表 */
export async function switchList(
  params?:any,
  options?: { [key: string]: any },
) {
  return request<API.Result_PageInfo_UserInfo__>('/api/sys/switch/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 设置开关 */
export async function updateSwitch(
  body?: any,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>('/api/sys/update/switch', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

export async function isOpen(
  params?:any,
  options?: { [key: string]: any },
) {
  return request<API.Result_PageInfo_UserInfo__>('/api/sys/isOpen', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}



// 新增系统配置
export async function insertConfig(
  body: any,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>(`/api/sys/update/config`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
// 修改系统配置
export async function updateConfig(
  body: any,
  options?: { [key: string]: any },
) {
  return request<API.Result_UserInfo_>(`/api/sys/update/config`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
// 系统配置详情
export async function configDetail(
  params?:any,
  options?: { [key: string]: any },
) {
  return request<API.Result_PageInfo_UserInfo__>('/api/sys/config/detail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
